package com.github_Dididipapa.shortlink.project.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github_Dididipapa.shortlink.project.dao.entity.Link;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;


import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @description: To be defined
 * @author: dididi_papa
 * @email: mitis1624087624@gmail.com
 * @date: 2025/09/12  11:16
 */
@Mapper
public interface LinkMapper extends BaseMapper<Link> {

    void removeBatchByIds(@Param("list") List<String> collect);

    @MapKey("gid")
    Map<String, Integer> listGroupShortLinkCount(@Param("list") List<String> reqestParams);

    void updateBatchById(@Param("list") List<Link> recycleLink);

    @Select("select short_uri from t_link")
    Set<String> setOfShortUri();

    void linkInsertBatch(@Param("links") ArrayList<Link> links);
}
